/**
 * Created by Yun on 2016-09-17.
 */

import React from 'react';

export default function Text({children, ...others}){
  const text = children;
  const ret = [];
  text.replace(/ /g, "\u00a0").split('\n').forEach((piece, i)=>{
    ret.push(piece);
    ret.push(<br key={i}/>);
  });
  ret.pop();
  return <span {...others}>{ret}</span>;
}